﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace ADUSWebApp.Controllers
{
    public class HelloWorldController : Controller
    {
        //
        // GET: /HelloWorld/

        //public string Index()
        //{
        //    return "Hello World!";
        //}
        public ActionResult Index()
        {
            return View();
        }

        //
        // GET: /HelloWorld/Welcome

        //public string Welcome()
        //{
        //    return "This is Welcome action method";
        //}

        //public string Welcome(string name, int numTimes = 1)
        //{
        //    return HttpUtility.HtmlEncode("Hello " + name + ", numTimes = " + numTimes);
        //}

        public ActionResult Welcome(string name, int numTimes = 1)
        {
            var viewModel = new WelcomeViewMode
            {
                Message = "Hello " + name,
                NumTimes = numTimes
            };
            return View(viewModel);
        }

        //Add a new "WelcomeViewModel" class 
        public class WelcomeViewMode
        {
            public string Message { get; set; }
            public int NumTimes { get; set; }
        }

    }
}
